using System;
using System.IO;
using AntEater.ComponentModel;

namespace AntEater.Runtime.Services.Building
{
    /// <summary>
    /// The building service interface defines a common interface for
    /// a building service.
    /// </summary>
    public interface IBuildingService : IRuntimeService
    {
        /// <summary>
        /// Gets or sets the build engine path.
        /// </summary>
        /// <value>The build engine path.</value>
        string BuildEnginePath {
            get;
            set;
        }

        /// <summary>
        /// Gets the external build properties.
        /// </summary>
        /// <value>The external build properties.</value>
        ExternalBuildPropertyCollection ExternalBuildProperties {
            get;
        }

        /// <summary>
        /// Registers a logger to which the logging information
        /// of the building process is passed.
        /// </summary>
        /// <param name="logger">The logger.</param>
        void RegisterLogger(IBuildingLogger logger);

        /// <summary>
        /// Builds the specified buildfile.
        /// </summary>
        /// <param name="stream">The stream of the build file.</param>
        /// <param name="filename">The filename.</param>
        /// <returns></returns>
        bool Build(Stream stream, string filename);

        /// <summary>
        /// Builds the specified buildfile.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="filename">The filename.</param>
        /// <param name="target">The target.</param>
        /// <returns></returns>
        bool Build(Stream stream, string filename, string target);

        /// <summary>
        /// Builds the specified buildfile.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="filename">The filename.</param>
        /// <param name="targets">The targets.</param>
        /// <returns></returns>
        bool Build(Stream stream, string filename, string[] targets);
    }
}
